#!/usr/bin/env python
# -*- coding:utf-8 -*-

import types
import time

@types.coroutine
def switch():
    time.sleep(2)
    yield 12

async def coro1():
    print("C1: Start")
    res = await switch()
    print(res)
    print("C1: Stop")
    
async def coro2():
    print("C2: Start")
    print("C2: a")
    print("C2: b")
    print("C2: c")
    print("C2: Stop")
    
    
def run(coros):
    coros = list(coros)

    while coros:
        # Duplicate list for iteration so we can remove from original list.
        for coro in tuple(coros):
            try:
                coro.send(None)
            except StopIteration:
                coros.remove(coro)
                
c1 = coro1()
c2 = coro2()
run([c1, c2])